-- GENERATED SPELL FOR [Westguard Rifleman] --


function spell0_24197(pUnit, Event) --@Hamstring,n/a--
pUnit:FullCastSpellOnTarget(9080,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24197', 10343, 1)
end

function spell1_24197(pUnit, Event) --@Shield Bash,n/a--
pUnit:FullCastSpellOnTarget(11972,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24197', 8334, 1)
end

function spell2_24197(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(16100,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24197', 596, 1)
end

function Sorts_24197(pUnit, Event)
local choix_sorts_24197 = math.random(0, 2)
if choix_sorts_24197 == 0 then
pUnit:RegisterEvent('spell0_24197', 1, 1)
end
if choix_sorts_24197 == 1 then
pUnit:RegisterEvent('spell1_24197', 1, 1)
end
if choix_sorts_24197 == 2 then
pUnit:RegisterEvent('spell2_24197', 1, 1)
end
end

function mob24197_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_24197', math.random(1500, 3000), 1)
end

function mob24197_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24197_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24197_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(24197, 1, 'mob24197_Action')
RegisterUnitEvent(24197, 2, 'mob24197_Leave')
RegisterUnitEvent(24197, 3, 'mob24197_Kill')
RegisterUnitEvent(24197, 4, 'mob24197_Die')
